import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'

Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const routes = [
  {
    path: '/',
    name: 'home',
    redirect:"/login",

  },
  {
    path: "/login",
    name:"/Login",
    component: Login
  },
  {
    path: "/main",
    name:"Main",
    component: ()=>import("../views/Main"),
    children:[
      {
        path: "/system/user",
        name:"User",
        component: ()=>import('@/views/system/User.vue')

      },
      {
        path: "/doctor/scheduling",
        name:"Scheduling",
        component: ()=>import('@/views/docter/Scheduling.vue')

      }
    ]
  },


]

const router = new VueRouter({
  routes
})

export default router
